<div id="user_menu">
	<?php echo $this->renderPartial('_menu', array('title'=>'Yii Rock!')); ?>
</div>
<?php
$this->breadcrumbs=array(
	$this->module->id,
);
?>

<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-setting-form',
	'enableAjaxValidation'=>true,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php //echo $form->errorSummary($model); ?>

	<div class="row who-can-register">
		<?php echo $form->labelEx($model,'who_can_register',array('class'=>'bold')); ?>
		<br />
		<?php echo $form->radioButtonList($model,'who_can_register',array('admin'=>'Administrator only', 'visitor'=>'Visitor','approval'=>'Visitor, but administrator approval is required')); ?>
		<br />
		<?php echo $form->checkBox($model,'email_verify_required');?>
		<?php echo $form->labelEx($model,'email_verify_required'); ?>
		<?php echo $form->error($model,'who_can_register'); ?>
		<br />
	</div>
	<div class="row email-setting">
		<?php $tabs = array(
			array('title'=>'Welcome(by admin)','view'=>'_setting_admin_email','data'=>array('model'=>$model,'form'=>$form)),
			array('title'=>'Welcome(Approval)','view'=>'_setting_approval_email','data'=>array('model'=>$model,'form'=>$form)),
			array('title'=>'Welcome(Visitor)','view'=>'_setting_visitor_email','data'=>array('model'=>$model,'form'=>$form)),
			array('title'=>'Password','view'=>'_setting_password_email','data'=>array('model'=>$model,'form'=>$form)),
			array('title'=>'Activation','view'=>'_setting_activated_email','data'=>array('model'=>$model,'form'=>$form)),
		);?>
		<?php $this->widget('CTabView',array('tabs'=>$tabs,'cssFile'=>Yii::app()->theme->baseUrl.'/css/jquery.tabs.css')) ?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton('Save setting'); ?>
	</div>

<?php $this->endWidget(); ?>
</div><!-- form -->